package com.test.plugin;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.widget.Toast;

import com.alibaba.fastjson.JSONObject;
import com.taobao.weex.WXSDKEngine;
import com.taobao.weex.annotation.JSMethod;
import com.taobao.weex.bridge.JSCallback;

public class PluginModule extends WXSDKEngine.DestroyableModule {
    @Override
    public void destroy() {
        ;
    }
    @JSMethod(uiThread = true)
    public void test(JSONObject options, final JSCallback jsCallback) {
        String s = options.getString("a");
        AlertDialog alertDialog1 = new AlertDialog.Builder(mWXSDKInstance.getContext())
                .setTitle(s)
                .setMessage(s)
                .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        jsCallback.invoke("b");
                    }
                }).create();
        alertDialog1.show();
    }
}
